Skip to content

feat: surface SCM summaries in desktop#263

Open
whoisasx wants to merge 2 commits into
mainfrom
codex/scm-observer-v1
Open

feat: surface SCM summaries in desktop#263
whoisasx wants to merge 2 commits into
mainfrom
codex/scm-observer-v1

Conversation

@whoisasx

Copy link
Copy Markdown
Collaborator

Problem

The backend SCM observer already persists PR, CI, review, and mergeability facts, and /api/v1/sessions derives session status from those facts. The desktop app was not reliably surfacing that state: it treated /events as the main live signal, gated PR detail fetches on mock-style session.pullRequest data, and masked some backend statuses such as merged.

Scoped V1 behavior

  • Desktop fetches current sessions from GET /api/v1/sessions and treats backend session.status as authoritative.
  • Desktop keeps GET /api/v1/events open as an invalidation stream only.
  • Visible/focused desktop surfaces fetch concise SCM summaries from GET /api/v1/sessions/{sessionId}/pr.
  • The summary API exposes user-facing SCM details only:
    • PR identity, title, branches, author, repo, provider links, and observed timestamps.
    • CI aggregate state plus failing/cancelled check names and links.
    • Review decision plus reviewer IDs, counts, and links for unresolved human comments.
    • Mergeability state, concise reason codes, and PR link.
  • The desktop understands no_signal, preserves backend merged even for terminated rows, and uses a neutral unknown fallback for unrecognized status values.

Backend changes

  • Added a session-service PR summary read model assembled from existing persisted PR, check, review-thread, and comment facts.
  • Expanded GET /api/v1/sessions/{sessionId}/pr to return SessionPRSummary items while leaving the PR claim response on the existing aggregate SessionPRFacts shape.
  • Added enum metadata for session status, PR state, CI state, failing-check status, review decision, and mergeability in the code-first OpenAPI contract.
  • Regenerated backend/internal/httpd/apispec/openapi.yaml and frontend/src/api/schema.ts.
  • Added tests covering the summary shape, failing check links without log tails, unresolved human reviewers without comment bodies, and conflict state without invented conflict files.

Frontend changes

  • Added useSessionScmSummary(sessionId) over the generated SessionPRSummary type.
  • Invalidates both workspace/session queries and SCM-summary queries from daemon status changes, SSE events, SSE reconnects, and API base URL changes.
  • Session inspector now fetches PR summaries without requiring pre-existing session.pullRequest data and renders PR, CI, review, and mergeability sections.
  • Board cards fetch compact visible-session SCM context and show PR/CI/review/mergeability highlights.
  • Pull requests page is backed by real session-scoped PR summaries rather than WorkspaceSession.pullRequest.
  • Fixed status handling for no_signal, merged, unknown fallback, and the sidebar daemon readiness indicator (ready, not running).

Intentional omissions / future work

  • No raw CI logs or log tails are exposed in the desktop summary API/UI.
  • No review comment bodies are exposed in the desktop summary API/UI.
  • Bot-authored review comments are excluded from review attention summaries.
  • Conflict files are not detected or invented in V1; conflictFiles remains empty unless real conflict-file facts exist later.
  • No new full-data status stream API, notification-center behavior, OS notifications, tracker observer status, or global PR listing endpoint is added in this V1.

Tests run

  • npm run api
  • cd backend && go test ./internal/service/session ./internal/httpd/controllers ./internal/httpd/apispec/...
  • npm run frontend:typecheck
  • npm --prefix frontend run test -- src/renderer/types/workspace.test.ts src/renderer/hooks/useWorkspaceQuery.test.tsx src/renderer/lib/event-transport.test.ts src/renderer/components/Sidebar.test.tsx

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@whoisasx whoisasx requested a review from Copilot June 16, 2026 19:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants